import os
import platform
import re
import shlex
import subprocess

import yaml


def which_shell():
    p = subprocess.Popen(shlex.split("echo $SHELL"),
                         stdout=subprocess.PIPE,
                         stderr=subprocess.STDOUT)
    print(p.stdout.read())
    return p.stdout.read().decode("utf-8")


def config(filename):
    with open(filename, "r", encoding="utf-8") as f:
        data = yaml.safe_load(f.read())
    default_shell = which_shell()
    print(default_shell)
    print(data["shell"])


config("alacritty.toml")
